<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.UserModule.bean.*"%>
<%@page import="com.UserModule.dao.*"%>
<%@page import="java.util.*"%>
<%@page import="util.*"%>
<%@page import="com.dianbo.bean.*,com.dianbo.dao.*,com.jifen.dao.*,com.jifen.bean.*,com.dati.bean.*,com.dati.dao.*"%>
<jsp:include page="../head.jsp"></jsp:include>
<body>
<div id="pager">
<jsp:include page="../top.jsp"><jsp:param name="topCurrent" value="8" /></jsp:include>
<jsp:include page="Left.jsp"> <jsp:param name="um" value="12" /></jsp:include> 
<form action="" id="frmMessage" name="frmMessage"></form>
    <section id="container">
    <%
    //---------分页
    int currentPage=1;
    if(request.getParameter("Page")!=null)
    {
    	currentPage=Integer.parseInt(request.getParameter("Page"));
    }
  	String result = session.getAttribute("result").toString();
    %>
    <div id="crumbs">
        	积分管理 &raquo; 下行积分列表
    </div>
    <!-- <div id="deleteContent"></div> -->
        <div id="main">
        	<div class="tabs">
                <ul class="tabs-nav clearfix">
                    <li>答题下行积分</li>
                    <li>点播下行积分</li>
                </ul>
                
                
                
                <div class="tabs-panel">
                <%
				if(!result.equals("")){
					out.println("<script>alert('"+result+"');</script>");
					session.removeAttribute("result");
				}
	            int colSpanNum=11;
				
                   
                %>
               <table width="100%" class="datalist">
                    	<thead>
                        	<tr>
                            	<td class="tc">类型</td>
                            	<td class="tc">分数</td>
                            	<td class="tc">创建时间</td>
                            	<td class="tc">设置</td>
                            </tr>
                        </thead>
                           <%
                           List<DatiType> datiTypeList = (ArrayList<DatiType>)session.getAttribute("datiTypeList");
                            if(datiTypeList!=null&&datiTypeList.size()>0){
                            	for(DatiType datiType:datiTypeList){
                            		%>
                            		<tr>
                        	<td class="tc">
                        	 <%=datiType.getTypeName() %>
                        	</td>
                        	<td class="tc">
                        	 <%
                        	 String condition = " typeId='"+datiType.getAnswerTypeId()+"' and integralType=1";
                        	 JiFen jiFen = new JifenDao().getJiFen("tb_integral","setTime",condition);
                        	 if(jiFen!=null){
                        		 %>
                        		 <%=jiFen.getIntegralValue() %>
                        		 <%
                        	 }
							 %>
                        	</td>
                        	<td class="tc">
                        	 <%=datiType.getCreateTime() %>
                        	</td>
                        	<td class="tc"style="cursor:hand"><a onclick="msg=$.msgbox({
        height:400,
        width:500,
        content:{type:'iframe', content:'./DatiServlet?method=setDown&dianboId=<%=datiType.getAnswerTypeId() %>&num=<%=new Random().nextInt(10000) %>'},
        title: '答题下行积分设置'
    });">设置</a></td>
                        	</tr>
                            		<%
                            	}
                            }
                           %>
                        	
                    </table>
                </div>   
                <div class="tabs-panel">

                	<table width="100%" class="datalist">
                    	<thead>
                        	<tr>
                            	<td class="tc">类型</td>
                            	<td class="tc">分数</td>
                            	<td class="tc">创建时间</td>
                            	<td class="tc">设置</td>
                            </tr>
                        </thead>
                           <%
                            List<DianboType> dianboTypeList = (ArrayList<DianboType>)session.getAttribute("dianboTypeList");
                            if(dianboTypeList!=null&&dianboTypeList.size()>0){
                            	for(DianboType dianboType:dianboTypeList){
                            		%>
                            		<tr>
                        	<td class="tc">
                        	 <%=dianboType.getTypeName() %>
                        	</td>
                        	<td class="tc">
                        	 <%
                        	 String condition = " typeId='"+dianboType.getTypeId()+"' and integralType=1";
                        	 JiFen jiFen = new JifenDao().getJiFen("tb_integral","setTime",condition);
                        	 if(jiFen!=null){
                        		 %>
                        		 <%=jiFen.getIntegralValue() %>
                        		 <%
                        	 }
							 %>
                        	</td>
                        	<td class="tc">
                        	 <%=dianboType.getCreateTime() %>
                        	</td>
                        	<td class="tc"style="cursor:hand"><a onclick="msg=$.msgbox({
        height:400,
        width:500,
        content:{type:'iframe', content:'./DianboServlet?method=setDown&dianboId=<%=dianboType.getTypeId() %>&num=<%=new Random().nextInt(10000) %>'},
        title: '点播积分设置'
    });">设置</a></td>
                        	</tr>
                            		<%
                            	}
                            }
                           %>
                        	
                    </table>
                </div>   
        	</div>
        </div>
  </section>
  <jsp:include page="../foot.jsp"></jsp:include>
  </div>
</body>
</html>
